package 哈希表;

import javax.swing.plaf.basic.BasicScrollPaneUI;
import java.util.Scanner;

public class TestDemo {
    public static void main(String[] args) {
        HashTable ht = new HashTable(7);

        String k = "";
        Scanner sc = new Scanner(System.in);
        while (true) {
            System.out.println("add : 添加雇员");
            System.out.println("List: 显示雇员");
            System.out.println("find: 查找雇员");
            System.out.println("exit: 退出系统");
            k = sc.nextLine();
            switch (k) {
                case "add":
                    System.out.println("请输入你要添加的雇员信息");
                    ht.add(new Emp(sc.nextInt(), sc.nextLine()));
                    break;
                case "list":
                    ht.list();
                    break;
                case"find":
                    System.out.println("请输入你要查找的ID");
                    ht.findEmp(sc.nextInt());
                    break;
                case "exit":
                    sc.close();
                    System.exit(0);
                default:
                    break;
            }
        }
    }
}
